#ifndef APP_H
#define APP_H

#include <QObject>
#include <QApplication>
#include "XXlaunch.h"

class App : public QApplication
{
    Q_OBJECT
public:
    explicit App(int &argc, char **argv);

    // config
    void configMainView(QWidget *mainView, bool showMaximized=true);
    void configMainView(std::function<QWidget*(void)> mainView, bool showMaximized=true);
    void configStyleSheetPath(const QString &filePath);

    // action
    int exec();

protected:
    void installMainView(QWidget *widget);
    void showMainView(bool re);
    bool eventFilter(QObject *w, QEvent *e);

private:
    Q_SIGNAL void sigShowMainView();

private:
    XXlaunch *_launchView;
    std::function<QWidget*(void)> _mainViewBlock;
    QWidget *_mainView;
    QString _ssPath;
    bool _showMaximized;
};

#endif // APP_H
